package com.sky.business.sys.controller;

import com.sky.business.sys.domain.Container;
import com.sky.business.sys.service.ContainerService;
import com.sky.common.api.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/container")
@Slf4j
@Tag(name = "容器管理", description = "容器管理控制层")
public class ContainerController {

    @Autowired
    private ContainerService containerService;

    @GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "容器列表")
    public Result<List<Container>> list() {
        List<Container> list = containerService.list();
        return Result.success(list);
    }
}
